package com.electromagnetic.industry.software.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.electromagnetic.industry.software.manage.pojo.models.User;
import com.electromagnetic.industry.software.manage.pojo.other.SearchKeyWords;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    /*
     * 通过用户编码查询用户
     *
     * @param userId
     * @return
     */
    User getSingleUser(String userId);

    /**
     * 通过用户编码查询用户
     *
     * @param searchKeywords
     * @return
     */
    List<User> search(SearchKeyWords searchKeywords);

    /**
     * 查询数据总条目数
     *
     * @param searchKeywords
     * @return
     */
    int getTotalCount(SearchKeyWords searchKeywords);

    /**
     * 查找用户角色名称
     *
     * @param userId
     * @return
     */
    List<String> selectUserRoles(String userId);
}
